Optimal. Leaf size=59 \[ \frac {x}{a}-\frac {2 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b} d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3868, 2738,
214} \begin {gather*} \frac {x}{a}-\frac {2 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d \sqrt {a-b} \sqrt {a+b}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 2738
Rule 3868
Rubi steps
\begin {align*} \int \frac {1}{a+b \sec (c+d x)} \, dx &=\frac {x}{a}-\frac {\int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{a}\\ &=\frac {x}{a}-\frac {2 \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a d}\\ &=\frac {x}{a}-\frac {2 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b} d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 60, normalized size = 1.02 \begin {gather*} \frac {\frac {c}{d}+x+\frac {2 b \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2} d}}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 65, normalized size = 1.10
method | result | size |
derivativedivides | \(\frac {\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 b \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) | \(65\) |
default | \(\frac {\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 b \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) | \(65\) |
risch | \(\frac {x}{a}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, d a}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, d a}\) | \(152\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.71, size = 230, normalized size = 3.90 \begin {gather*} \left [\frac {2 \, {\left (a^{2} - b^{2}\right )} d x + \sqrt {a^{2} - b^{2}} b \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right )}{2 \, {\left (a^{3} - a b^{2}\right )} d}, \frac {{\left (a^{2} - b^{2}\right )} d x - \sqrt {-a^{2} + b^{2}} b \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right )}{{\left (a^{3} - a b^{2}\right )} d}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{a + b \sec {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 218 vs.
\(2 (50) = 100\).
time = 0.48, size = 218, normalized size = 3.69 \begin {gather*} \frac {\frac {{\left (\sqrt {-a^{2} + b^{2}} {\left (a - 2 \, b\right )} {\left | -a + b \right |} - \sqrt {-a^{2} + b^{2}} {\left | a \right |} {\left | -a + b \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {b + \sqrt {{\left (a + b\right )} {\left (a - b\right )} + b^{2}}}{a - b}}}\right )\right )}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} a^{2} + {\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} {\left | a \right |}} + \frac {{\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {b - \sqrt {{\left (a + b\right )} {\left (a - b\right )} + b^{2}}}{a - b}}}\right )\right )} {\left (a - 2 \, b + {\left | a \right |}\right )}}{a^{2} - b {\left | a \right |}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.09, size = 186, normalized size = 3.15 \begin {gather*} \frac {2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a\,d}+\frac {2\,b\,\mathrm {atanh}\left (\frac {2\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+a^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+2\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-2\,a\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,a\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,\left (a\,b-a^2\right )}\right )}{a\,d\,\sqrt {a^2-b^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________